<?php

class Formatter extends CFormatter {
    public $numberFormat = array(
        'decimals' => 0,
        'decimalSeparator' => '.',
        'thousandSeparator' => ',',
    );
    
    public function formatDollar($value) {
        return '$' . $this->formatNumber($value);
    }
    
    public function formatDateType1($value) {
        return date('m-Y', strtotime($value));
    }
    
    public function formatDateType2($value) {
        return date('d-m-Y', strtotime($value));
    }
    
    public function formatDateType3($value) {
        return date('d-m-Y H:i', strtotime($value));
    }
    
    public function formatDateType4($value) {
        return date('d/m', strtotime($value));
    }

    public function formatNumberVi($value) {
        $this->numberFormat = array(
            'decimals' => 0,
            'decimalSeparator' => ',',
            'thousandSeparator' => '.',
        );
        return $this->formatNumber($value);
    }
}